package org.Vancl.Dao.ImpI;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.Vancl.Dao.GouMaiShoppingDao;
import org.Vancl.entity.shoppingcolor;
import org.Vancl.utils.BaseDao;

public class GouMaiShoppingDaoImpI extends BaseDao implements GouMaiShoppingDao {

	@Override
	public List<shoppingcolor> getid(int id) {
		String sql=" SELECT * FROM ShoppingColor WHERE sc_sid=?";
		ResultSet rs=super.executeQuery(sql, id);
		List<shoppingcolor> list=new ArrayList<>();
		try {
			while(rs.next()) {
				shoppingcolor sc=new shoppingcolor();
				sc.setSc_id(rs.getInt("sc_id"));
				sc.setSc_sid(rs.getInt("sc_sid"));
				sc.setSc_price(rs.getString("sc_price"));
				sc.setSc_name(rs.getString("sc_name"));
				sc.setSc_smallimages(rs.getString("sc_smallimages"));
				sc.setSc_bigimages(rs.getString("sc_bigimages"));
				sc.setColor(rs.getString("sc_Color"));
				sc.setSc_num(rs.getInt("sc_num"));
				sc.setSc_totalnum(rs.getInt("sc_totalnum"));
				sc.setSc_size(rs.getString("sc_size"));
				list.add(sc);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}finally {
			try {
				super.CloseAll(rs, rs.getStatement().getConnection(), rs.getStatement());
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return list;
	}


}
